//npm install mysql
const mysql = require("mysql");

//创建数据库连接
let con = mysql.createConnection({
    host: "192.168.174.166",
    user: "root",
    password: "ddd",
    database: "informationsys"
})

let sql = "select user_name, user_age,user_sex from users"

con.query(sql, (err, results, fields) => {
    if (err) {
        console.log(err)
    }
    else {
        console.log(results)
    }
})